home *** CD-ROM | disk | FTP | other *** search
- #define FOR_SYSTEM8_PREEMPTIVE 1
-
- #include <LowMem.h>
- #include <Types.h>
- #include <Patches.h>
- #include <CodeFragments.h>
- #include <Sound.h>
-
- #include "MMSharedData.h"
- #include "DemoPatchL.h"
-
- void LocalMoreMastersPatch(void);
- void DoSomePreprocessing(void);
- void DoSomePostprocessing(void);
-
- unsigned long gMyAppNumber;
-
- enum {
- kMyPatchCount = 1 /* Number of patches in my list */
- };
-
- /*
- * One patch description per patch
- */
- PatchDescription gMoreMastersPatchDescription = {
- &MoreMasters,
- &LocalMoreMastersPatch,
- {
- 'wild',
- 'demo'
- },
- {
- kNilOptions,
- {
- kDoNotMatchAnyOrderedItemService,
- kDoNotMatchAnyOrderedItemSignature
- },
- {
- kDoNotMatchAnyOrderedItemService,
- kDoNotMatchAnyOrderedItemSignature
- }
- },
- kPatchEnabledMask,
- paramErr,
- kInvalidID,
- NULL,
- kInvalidID
- };
-
- /*
- * The table with the list of patch descriptions (degenerate here as there is only one patch)
- */
- PatchDescription * gPatchDescriptionList[kMyPatchCount] = {
- &gMoreMastersPatchDescription
- };
-
- /*
- * The Patch Data block. This is exported as the patch fragment's main entry point
- */
- PatchHeader gPatchData = {
- kPatchHeaderTag,
- kPatchHeaderVersion,
- kNilOptions,
- kMyPatchCount,
- &gPatchDescriptionList[0]
- };
-
-
-
- /*
- * The patch itself.
- * Does some preprocessing, calls through to the rest of the patch chain, and
- * then does some postprocessing.
- */
-
- void LocalMoreMastersPatch(void)
- {
- // Debugger();
-
- if (gMMAppList[gMyAppNumber].appName[0] == 0)
- {
- BlockMoveData(LMGetCurApName(),&gMMAppList[gMyAppNumber].appName,
- sizeof(gMMAppList[gMyAppNumber].appName));
- }
-
- gMMAppList[gMyAppNumber].appMMCount++;
-
- // Call through
- (*(MoreMastersPatchProcPtr) gMoreMastersPatchDescription.thisCallThroughProc)();
- }
-
- /*
- * CFM init routine.
- *
- * Do not proceed if the patch could not be installed.
- */
-
- OSErr InitMyPatch(const CFragOpaqueInitBlock *initBlock)
- {
- #pragma unused ( initBlock )
-
- Debugger();
- if (gMoreMastersPatchDescription.installResult == noErr)
- {
- unsigned long myAppNumber;
-
- myAppNumber = ++gMMNextAppNumber;
- if (myAppNumber >= NUMAPPS)
- {
- gMMNextAppNumber = myAppNumber = 0;
- }
- gMyAppNumber = myAppNumber;
- }
-
- return (gMoreMastersPatchDescription.installResult);
- }
-